$(function () {
    $("#jqGrid").jqGrid({
    	url: '../erp/business/list',
        datatype: "json",
        colModel: [			
			{ label: '年月信息', name: 'yearMonth', width: '15%',key:true},
			{ label: '发货金额', name: 'deliveryAmount', width: '15%' },
			{ label: '开票金额', name: 'invoiceAmount', width: '15%' },
			{ label: '收款金额', name: 'recieveAmount', width: '15%' },
			{ label: '应收金额', name: 'acceptableAmount', width: '20%' }
			
        ],
		viewrecords: true,
        height: 400,
        rowNum: 10,
		rowList : [10,30,50],
        rownumbers: true, 
        rownumWidth: 25, 
        autowidth:true,
        multiselect: true,
        
        pager: "#jqGridPager",
        jsonReader : {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames : {
            page:"page", 
            rows:"limit", 
            order: "order"
        },
        gridComplete:function(){
        	//隐藏grid底部滚动条
        	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" }); 
        	$("#jqGrid tr:odd").css("background-color", "#3399CC");  
            $("#jqGrid tr:even").css("background-color", "#33CCCC");  
            //$("#jqGrid tr td").css({color:"red"});
       


        }
    });
});

	
var vm = new Vue({
	el:'#rrapp',
	data:{
		showList: true,
		title:null,

	},
	methods: {
		query: function () {
			vm.reload();
		},
		
	    reload: function (event) {
	    	vm.showList = true;
			var page = $("#jqGrid").jqGrid('getGridParam','page');
			$("#jqGrid").jqGrid('setGridParam',{ 
                postData:{},
                page:page
            }).trigger("reloadGrid");
		}
	}
});